<%@ include file="/WEB-INF/jsp/common/include.jsp" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ page import="com.google.appengine.api.users.*" %>
<html>
  <head>
    <title>
      <tiles:getAsString name="pageTitle" ignore="true"/>
    </title>
    <style type="text/css">
      @import url("/css/common.css");
    </style>
  </head>
  <body>
    <h1>Add your own ad</h1>

    <a href="/" class="<tiles:getAsString name='searchTab' ignore='true'/>tab">home</a> <a href="/ad/add/flatAdd.do" class="<tiles:getAsString name='addTab' ignore='true'/>tab">add ad</a> <a href="/admin/index.do" class="<tiles:getAsString name='adminTab' ignore='true'/>tab">admin</a>
    <%
      UserService userService = UserServiceFactory.getUserService();
      if (!userService.isUserLoggedIn()) {
    %>
       Please <a href="<%= userService.createLoginURL("/") %>">log in</a>
    <% } else { %>
       Welcome, <%= userService.getCurrentUser().getNickname() %>!
       (<a href="<%= userService.createLogoutURL("/") %>">log out</a>)
    <%
      }
    %>
    <tiles:insertAttribute name="body">
    </tiles:insertAttribute>
  </body>
</html>